package com.accesshollywood.GL;

import static org.lwjgl.opengl.GL11.GL_QUADS;
import static org.lwjgl.opengl.GL11.glBegin;
import static org.lwjgl.opengl.GL11.glColor3f;
import static org.lwjgl.opengl.GL11.glEnd;
import static org.lwjgl.opengl.GL11.glRotatef;
import static org.lwjgl.opengl.GL11.glScalef;
import static org.lwjgl.opengl.GL11.glTexCoord2f;
import static org.lwjgl.opengl.GL11.glTranslatef;
import static org.lwjgl.opengl.GL11.glVertex2f;

import java.awt.Image;

import org.newdawn.slick.opengl.Texture;

public class NoMatch extends Picture {

	public NoMatch(Texture texture) {
		super(texture);
	}

	public void renderGL() {
		if (texture != null) {
			texture.bind();
		}
		glTranslatef(posCurr.x, posCurr.y, posCurr.z);
		glRotatef(rotCurr.x, 1f, 0f, 0f);
		glRotatef(rotCurr.y, 0f, 1f, 0f);
		glRotatef(rotCurr.z, 0f, 0f, 1f);
		glScalef(scaleCurr.x, scaleCurr.y, scaleCurr.z);
		glTranslatef(-posCurr.x, -posCurr.y, -posCurr.z);

		//glColor3f(1.0f, 0.0f, 1.0f);
				glBegin(GL_QUADS);
				glTexCoord2f(0, 0);
				glVertex2f(posCurr.x - 150, posCurr.y - 50);
				glTexCoord2f(1, 0);
				glVertex2f(posCurr.x + 150, posCurr.y - 50);
				glTexCoord2f(1, 1);
				glVertex2f(posCurr.x + 150, posCurr.y + 50);
				glTexCoord2f(0, 1);
				glVertex2f(posCurr.x - 150, posCurr.y + 50);
				glEnd();
				
			}

			public float getWidth() {
				if (texture != null) {
					return 300 * scaleCurr.x;
				} else {
					return 0;
				}
			}

			public float getHeight() {
				if (texture != null) {
					return 100 * scaleCurr.y;
				} else {
					return 0;
				}
			}
		}
